<?php include("../config.php"); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><?php echo $sitename; ?> - Sysop: Find duplicate PAD files</title>
<meta name="description" content="<?php echo $sitename; ?> - Sysop: Check for duplicate PAD files">
<meta name="keywords" content="free to try, software, shareware, freeware, developers, vendors, download, PAD">
<meta name="author" content="Andrey Aleksanyants, M.D.">
<meta name="copyright" content="easy HTools">
<meta http-equiv="imagetoolbar" content="no">
<link rel="stylesheet" type="text/css" href="../<?php echo $cssfile; ?>">
<link rel="shortcut icon" href="../favicon.ico">
</head>
<body>
<table class="tmain" align="center" width="90%" cellspacing="0" cellpadding="0">
<tr>
<td class="tmain">
<table class="tlogo" align="center" width="100%" cellspacing="0" cellpadding="4">
<tr>
<td align="right">
<p><a href="index.php">Home</a></p>
</td>
</tr>
</table>
</td>
</tr><tr>
<td class="tmain">
<br>
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="1">
<tr valign="top">
<td class="tbody">
<h1><?php echo $sitename; ?> - Sysop: Find duplicate PAD files</h1>
<?php

$lastpad = "?";
$count = 0;

// Connecting to database
if(!($link_id = mysql_connect($dbhost, $userid, $userpassword))) {
	die("<p><b>Error connecting to the database server:</b> " . mysql_error() . "</p>\n");
}
mysql_select_db($dbname);
$result = mysql_query("SELECT padfile FROM paddata ORDER BY padfile", $link_id);
while($query = mysql_fetch_array($result)) {
	if(strcasecmp($lastpad,$query["padfile"]) == 0) {
		$count++;
		echo "<p>" . $lastpad . "</p>\n";
	}
	$lastpad = $query["padfile"];
}
echo "<p>Dupes found: " . $count . " </p><br>\n";

// Disconnect from database
mysql_close($link_id);
?>
<br>

</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>